package org.zn.plus.mybatis.sql.builder.model;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class QueryStatement implements Statement{
	
	//主查询方式 默认 query  ,其他 distinct ,count 等等  辅助处理
		private String queryType="query";
		
		private QueryTable mainTable;
		
		//???
		private  List<JoinTable> joinTables;
		
		private  int[] limit;
		
		private Map<String, Map<String, Object>> parameters;
		
		public void addJoinTable(JoinTable joinTable) {
			
			if(joinTables==null) {
				joinTables=new ArrayList<JoinTable>();
			}
			
			joinTables.add(joinTable);
			
		}
		

		public String getQueryType() {
			return queryType;
		}

		public void setQueryType(String queryType) {
			this.queryType = queryType;
		}

		public QueryTable getMainTable() {
			return mainTable;
		}

		public void setMainTable(QueryTable mainTable) {
			this.mainTable = mainTable;
		}

		public List<JoinTable> getJoinTables() {
			return joinTables;
		}

		public void setJoinTables(List<JoinTable> joinTables) {
			this.joinTables = joinTables;
		}

		public Map<String, Map<String, Object>> getParameters() {
			return parameters;
		}

		public void setParameters(Map<String, Map<String, Object>> parameters) {
			this.parameters = parameters;
		}

		public int[] getLimit() {
			return limit;
		}

		public void setLimit(int start,int end) {
			this.limit = new int[] {start,end};
		}
		

}
